package com.sc.design.mediator;

import java.util.Random;

public class Sale extends AbstractColleague {
    public Sale(AbstractMediator _mediator) {
        super(_mediator);
    }
    public void saleComputer(int count){
        super.mediator.execute("sale.sell",count);
        System.out.println("出售"+count);
    }
    public int getSaleStatus() {
        Random random = new Random(System.currentTimeMillis());
        int saleStatus = random.nextInt(100);
        System.out.println("销售情况为"+saleStatus);
        return saleStatus;
    }
    public void offSale()
    {
        super.mediator.execute("sale.offsell");
    }
}
